#include<iostream>
#include<signal.h>
#include<unistd.h>
#include<stdlib.h>
using namespace std;
void myhendler(int signal)
{
    cout<<"signal:"<<signal<<endl;
    exit(0);
}
int main()
{
    // signal(2,myhendler);
    // signal(2,SIG_DFL);//默认模式；0
    
    int cnt = 0;
    while(true)
    {

        cout<<"process continue:pid:"<<getpid()<<endl;
        sleep(1);
        cnt++;
        if(cnt == 20)
        {
            raise(SIGINT);
        }
    }
    return 0;
}